# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

_pyname=ailment
pkgname=python-${_pyname}
pkgver=9.2.27
pkgrel=2
pkgdesc='The angr intermediate language'
url='https://github.com/angr/ailment'
license=('custom:BSD2')
arch=('any')
depends=('python' 'python-claripy' 'python-pyvex' 'python-pypcode')
makedepends=('python-build' 'python-installer' 'python-wheel' 'python-setuptools')
checkdepends=('python-pytest' 'python-archinfo')
source=("${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha512sums=('4e18dd1a85863fb8dbf4c0a57976f2dd641c6e28f12913c8c506308cf92bca29a5e27c9d2df7ca4b3478ad6bd4c25bd617830e86672b21b4672a30fd28adc2aa')
b2sums=('66433531fa93fbfc554a9c3995dfdddac9da5380d77ca2a5f4bc124c74f814675d13d2259a85b83387f9eb7699e687b8f5b7071cb33b75017a31885e80eaad63')

build() {
  cd ${_pyname}-${pkgver}
  python -m build --wheel --no-isolation
}

check() {
  cd ${_pyname}-${pkgver}
  # TODO: needed for angr (hard dep)
  # PYTHONPATH=build/lib pytest
}

package() {
  cd ${_pyname}-${pkgver}
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et:
